<%-- 
    Document   : showSkills
    Created on : 25.11.2012, 13:35:02
    Author     : Wendy
--%>

<%@ page contentType="text/html; charset=utf-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="f" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="s" uri="http://stripes.sourceforge.net/stripes.tld" %>
 
<f:message var="headline" key="skills.all"/>
<s:layout-render name="/content.jsp" nadpis="${headline}">
    <s:layout-component name="telo">
        <s:useActionBean beanclass="cz.muni.fi.hauntedhousesclient.SkillActionBean" var="actionBean"/>
        
        <table class="zakladni">
            <tr>
                <th><f:message key="skills.id"/></th>                
                <th><f:message key="skills.name"/></th> 
                <th><f:message key="skills.description"/></th>
                <th><f:message key="skills.causesFear"/></th>
                <th><f:message key="skills.power"/></th>                
            </tr>
            <c:forEach items="${actionBean.skills}" var="skill">
                <tr>
                    <td>${skill.id}</td>
                    <td><c:out value="${skill.name}"/></td>
                    <td><c:out value="${skill.description}"/></td>
                    <td><f:message key="Fear.${skill.causesFear}"/></td>
                    <td><c:out value="${skill.power}"/></td>                    
                    <td><s:link beanclass="cz.muni.fi.hauntedhousesclient.SkillActionBean" event="delete"><s:param name="skill.id" value="${skill.id}"/><f:message key="skills.delete"/></s:link> </td>
                    <td><s:link beanclass="cz.muni.fi.hauntedhousesclient.SkillActionBean" event="edit"><s:param name="skill.id" value="${skill.id}"/><f:message key="skills.edit"/></s:link> </td>
                </tr>
            </c:forEach>
        </table>
        <s:form beanclass="cz.muni.fi.hauntedhousesclient.SkillActionBean">
            <fieldset><legend><f:message key="skills.addNewSkill"/></legend>
                <%@include file="formSkill.jsp"%>
            <s:submit name="add"><f:message key="skills.add"/></s:submit>
            </fieldset>
        </s:form>  
    </s:layout-component>
</s:layout-render>
